package com.example.yqand4v1_1.service;

import com.example.yqand4v1_1.dao.ActivityEntityMapper;
import com.example.yqand4v1_1.dao.entity.Activity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

@Service
public class ActivityService {
    @Autowired
    private ActivityEntityMapper activityEntityMapper;
    public ArrayList<Activity> queryActivitiesByAmount(int count,int amount)
    {
        return activityEntityMapper.queryActivitiesByAmount(count,amount);
    }
    public int updateActivity(Activity activity)
    {
        return activityEntityMapper.updateActivity(activity);
    }
    public int participateActivity(int volunteerId,int activityId)
    {
        return activityEntityMapper.participateActivity(volunteerId,activityId);
    }
    public Activity querySingleActivityById(int id)
    {
        return activityEntityMapper.querySingleActivityById(id);
    }
    public ArrayList<Integer> queryActivitiesIdOfVolunteer(int volunteerId){
        return activityEntityMapper.queryActivitiesIdOfVolunteer(volunteerId);
    }
    public int queryTotalNumOfActivities()
    {
        return activityEntityMapper.queryTotalNumOfActivities();
    }
}
